package com.zareal.ymcc.doc;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Document(indexName = "course", type = "_doc")
public class CourseSearchDoc {
    @Id
    // 课程id
    private Long id;
    @Field(type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    // 课程名字
    private String name;
    @Field(type = FieldType.Long)
    // 课程类型id
    private Long courseTypeId;
    @Field(type = FieldType.Keyword)
    // 课程等级
    private String GradeName;
    @Field(type = FieldType.Keyword)
    // 课程是否收费
    private String chargeName;
    @Field(type = FieldType.Double)
    // 课程价格
    private Double price;
    @Field(type = FieldType.Double)
    // 课程打折前的价格
    private Double priceOld;

    @Field(type = FieldType.Keyword)
    // 照片路径
    private String pic;

    @Field(type = FieldType.Keyword)
    // 适用人群
    private String forUser;

    @Field(type = FieldType.Keyword)
    private String courseTypeName;

    @Field(type = FieldType.Date)
    private Date startTime;

    @Field(type = FieldType.Date)
    private Date endTime;

    @Field(type = FieldType.Integer)
    private Integer totalMinute;

    @Field(type = FieldType.Date)
    private Date onlineTime;

    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    private String teacherNames;

    @Field(type = FieldType.Keyword)
    private String qq;

    @Field(type = FieldType.Integer)
    private Integer validDays;

    @Field(type = FieldType.Integer)
    private Integer saleCount;

    @Field(type = FieldType.Integer)
    private Integer viewCount;

    @Field(type = FieldType.Integer)
    private Integer commentCount;

}
